Syntax studies the structure
of phrases and sentences. Think of this like grammar. Natural Language Processing uses
syntactic rules to break down sentences into their grammatical parts to understand the
structure of the sentence. This is called part-of-speech tagging. Parts of speech or things like
nouns, verbs, adjectives, adverbs, and the like are all
considered the syntactic category. The tagging happens when
you assign each word in a sentence the
appropriate part of speech. For example, in the sentence, "Time flies like an arrow", time is a noun, flies is a verb, like is a preposition, an is a determiner, and arrow is also a noun. Part-of-speech tagging has some
challenges with ambiguity, as some words can actually
have multiple parts of speech. The word saw can be
both a noun and a verb. Like can be a noun, verb, adjective, preposition,
particle, or even a conjunction. There are a number of NLP methods
to handle these ambiguous cases. Most use a corpus or a set
of texts that has been manually annotated to
assign part of speech. You use this corpus to determine the likelihood of a word being
a particular part of speech. Rule-based systems just use the most
frequent part of speech for the word. More advanced techniques, like
statistical-based methods, may use tools like Hidden Markov Models to determine the optimal selection
for the part of speech. These methods are challenging
because the corpus used must be representative of the text you
play and analyze with the tool. Producing the annotations
of the corpus is time-consuming and expensive to produce. Once each word has been
assigned a part of speech, the syntax or structure of
the sentence is identified. There are three ways that structure
is usually described: tree notation, bracketed notation, and XML format. Let's diagram the sentence, "The patient has pain
in lower extremities". First, we assign the part of speech for each word and then we start to
combine words into phrases. So, lower and extremities are
combined into a noun phrase or NP. We can combine in with the noun phrase
to create a prepositional phrase. Adding in pain gives another noun phrase, which combined with had, is a verb phrase. Finally, we can combine the noun phrase, the patient, with that long verb phrase
to form the full sentence. Bracketed notation first brackets
the word with the part of speech, then brackets phrases, and finally, brackets the whole sentence. XML work similarly, but
instead of brackets, you have opening and closing tags for parts of speech, phrases, and sentences. As with parts-of-speech tagging, the correct syntax is not always clear. For example, the sentence, "The man saw a woman with binoculars" can mean the man saw a woman with binoculars, or it can mean the man saw
a woman with binoculars. This is an example of
different adjunct placement. There can also be challenges with
the correct scope of the conjunction. For example, the sentence, "Pain in hands and feet,"
clearly means that both the hands and feet have pain. But if we change the sentence slightly
to "Pain in hands and fever", now pain only refers to
hands but not fever. You can also have long distance dependencies when there are explanatory clauses in the sentence. For example, in the sentence, "The patient has neuropathy, a type of nerve damage in his feet." The neuropathy is referring
to the patient's feet, but the two words are far apart. As you can see, much like
everything else in NLP, syntactic analysis of regular texts
is a very challenging task. Applying these methods to
clinical text is even more challenging because of the shorthand in ill-formed
sentences common in clinical notes.